package com.haikesi.api.typetemplate.domain.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = false)
public class TypeTemplateSearchVO implements Serializable {

    private static final long serialVersionUID = -1L;

    @ApiModelProperty(value = "Id")
    private String id;

    @ApiModelProperty(value = "分类的code唯一码")
    private String typeId;

    @ApiModelProperty(value = "模板名称")
    private String templateName;

    @ApiModelProperty(value = "模板类型")
    private String templateType;

    @ApiModelProperty(value = "模板代码块")
    private String templateCode;

    @ApiModelProperty(value = "是否默认模板")
    private Integer templateDefault;

    @ApiModelProperty(value = "是否通用模板")
    private Integer templateIsCommon;

    @ApiModelProperty(value = "模板图片")
    private String templateImage;

    @ApiModelProperty(value = "模板唯一标识")
    private String templateSign;

    @ApiModelProperty(value = "组织机构ID")
    private String organizationId;

    @ApiModelProperty(value = "是否筛选机构数据(1 是 0 否 默认为否)", required = true)
    private String isScreenOrganization;


    @ApiModelProperty(value = "页数")
    private Integer pageNum;

    @ApiModelProperty(value = "每页行数")
    private Integer pageSize;

    public Integer getPageNum() {
        if (pageNum == null) {
            pageNum = 1;
        }
        return pageNum;
    }

    public Integer getPageSize() {
        if (pageSize == null) {
            pageSize = 20;
        }
        if (pageSize > 100) {
            pageSize = 100;
        }
        return pageSize;
    }
}
